<?php
/**
 * *********************************************************************************************************************
 * 派件清单(其实没必要，所有有派件列表的品牌都放在这个目录，好看)
 * *********************************************************************************************************************
 */
namespace soa\delivery;

use soa\client;

class Ane extends client
{
    /**
     * @var string
     */
    public $service_url = 'http://express.core.kuaidihelp.com';

    /**
     * @var string
     */
    public $service_name = 'kuaidihelp_express';

    /**
     * http 请求超时时间
     *
     * @var int
     */
    protected $_timeout = 20;

    /**
     * @param $thirdPartyId
     * @param $empNo
     * @param $beginDate
     * @param $endDate
     * @param $mobile
     * @param string $type
     * @param int $appVersion
     * @return array|bool|null
     */
    public function getDeliveryList($thirdPartyId, $empNo, $beginDate = '', $endDate = '', $mobile = '', $type = '', $appVersion = 0)
    {
        if(empty($empNo))
            return [];

        $result = $this->post('/v1/express/Delivery/getDeliveryList', [
            'brand'        => 'ane',
            'type'         => $type,
            'appVersion'   => $appVersion,
            'thirdPartyId' => $thirdPartyId,
            'empNo'        => $empNo,
            'beginDate'    => $beginDate ? date('Y-m-d H:i:s', strtotime($beginDate)) : date('Y-m-d 00:00:00'),
            'endDate'      => $endDate ? date('Y-m-d H:i:s', strtotime($endDate)) : date('Y-m-d 23:59:59'),
            'mobile'       => $mobile,
        ]);

        return $result;
    }

}